package cn.ekuma.odbo.mobile.category

import org.junit.Test
import kotlin.random.Random

/*
class CategoryItemTreeTest {

    @Test
    fun testItemTreeBuild(){
        val root=buildFileTree()
        println(root.toString())
    }


    private fun buildFileTree(level:Int=0): DirCategoryItem {
        val root=DirCategoryItem(Dir("path_$level"))
        val endInt=Random.nextInt(10)
        (1..endInt).forEach {dirIndex->
            val path=DirCategoryItem(Dir("path_${level}_$dirIndex"))
            root.add(path)
            val endInt=Random.nextInt(5)
            //println("random $endInt")
            (0..endInt).forEach{ index->
               val file=FileCategoryItem(File("file_${level}_${dirIndex}_${index}"))
               path.add(file)
            }
            if( endInt%3==0 && level<5 ) {
                val dir = buildFileTree(level+1)
                path.add(dir)
            }
        }
        val longFile=LongFileCategoryItem(LongFile("long_file_${level}",100L*endInt))
        root.add(longFile)
        return root
    }

}


class DirCategoryItem(dir: Dir) : CategoryItemWarp<Dir>(dir) {

}

class FileCategoryItem(file: File):CategoryItemWarp<File>(file){

}

class LongFileCategoryItem(file: LongFile):CategoryItemWarp<LongFile>(file){

}

data class Dir(val path:String):AbstractCategoryItem<String>(path){

}

data class File(val name:String):AbstractCategoryItem<String>(name){

}

data class LongFile(val name:String,val longSize:Long):AbstractCategoryItem<Long>(longSize){

}*/